<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>JCSDK Java API Reference for Android: com.juphoon.cloud.JCPushTemplate Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">JCSDK Java API Reference for Android
   &#160;<span id="projectnumber">2.3.3</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.16 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>com</b></li><li class="navelem"><b>juphoon</b></li><li class="navelem"><b>cloud</b></li><li class="navelem"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push_template.html">JCPushTemplate</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push_template-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">com.juphoon.cloud.JCPushTemplate Class Reference<div class="ingroups"><a class="el" href="group___xE6_x8E_xA8_xE9_x80_x81_xE6_xA8_xA1_xE5_x9D_x97.html">推送模块</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a7a91aa885fe40170f59054729cde1a2c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push_template.html#a7a91aa885fe40170f59054729cde1a2c">initWithMiPush</a> (String appPackage, String regId)</td></tr>
<tr class="separator:a7a91aa885fe40170f59054729cde1a2c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a49bc49b2e5651e1c852c4b98e86eb1a7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push_template.html#a49bc49b2e5651e1c852c4b98e86eb1a7">initWithHmsPush</a> (String appId, String token)</td></tr>
<tr class="separator:a49bc49b2e5651e1c852c4b98e86eb1a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6f47594dc861210e305ea776424acfd0"><td class="memItemLeft" align="right" valign="top"><a id="a6f47594dc861210e305ea776424acfd0"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>initWithGCM</b> (String senderId, String token)</td></tr>
<tr class="separator:a6f47594dc861210e305ea776424acfd0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a57754757defcddda05dd2fdeb186e74c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push_template.html#a57754757defcddda05dd2fdeb186e74c">initWithCall</a> (@PushManufacturer int pushFactory, String selfId, String description, String passThrough, String huaweiNotifyJson)</td></tr>
<tr class="separator:a57754757defcddda05dd2fdeb186e74c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac439a3ad1106ea4e17540609461535eb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push_template.html#ac439a3ad1106ea4e17540609461535eb">initWithText</a> (@PushManufacturer int pushFactory, String selfId, String type, String description, String passThrough, String huaweiNotifyJson)</td></tr>
<tr class="separator:ac439a3ad1106ea4e17540609461535eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af3889147f307b5065c67a5e41a7e215c"><td class="memItemLeft" align="right" valign="top">String&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push_template.html#af3889147f307b5065c67a5e41a7e215c">getData</a> ()</td></tr>
<tr class="separator:af3889147f307b5065c67a5e41a7e215c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:a9a7cac280e92a23672dbcef3e5b03d65"><td class="memItemLeft" align="right" valign="top">static final int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push_template.html#a9a7cac280e92a23672dbcef3e5b03d65">XIAOMI</a> = 0</td></tr>
<tr class="separator:a9a7cac280e92a23672dbcef3e5b03d65"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8641da1c5058e925c89001fca7ad168e"><td class="memItemLeft" align="right" valign="top">static final int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push_template.html#a8641da1c5058e925c89001fca7ad168e">HUAWEI</a> = 1</td></tr>
<tr class="separator:a8641da1c5058e925c89001fca7ad168e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a73bad171784091fc8c0862bc5e2cb536"><td class="memItemLeft" align="right" valign="top">static final int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_push_template.html#a73bad171784091fc8c0862bc5e2cb536">GCM</a> = 2</td></tr>
<tr class="separator:a73bad171784091fc8c0862bc5e2cb536"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>推送模版类 </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a7a91aa885fe40170f59054729cde1a2c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7a91aa885fe40170f59054729cde1a2c">&#9670;&nbsp;</a></span>initWithMiPush()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void com.juphoon.cloud.JCPushTemplate.initWithMiPush </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>appPackage</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>regId</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>生成小米推送参数</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">appPackage</td><td>Justalk cloud 上注册的该应用的小米Push AppPackage 值 </td></tr>
    <tr><td class="paramname">regId</td><td>小米推送注册成功返回的 regId </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a49bc49b2e5651e1c852c4b98e86eb1a7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a49bc49b2e5651e1c852c4b98e86eb1a7">&#9670;&nbsp;</a></span>initWithHmsPush()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void com.juphoon.cloud.JCPushTemplate.initWithHmsPush </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>appId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>token</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>生成华为推送参数</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">appId</td><td>Justalk cloud 上注册的该应用的华为Push 的 AppId 值 </td></tr>
    <tr><td class="paramname">token</td><td>华为推送注册成功返回的 regId </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a57754757defcddda05dd2fdeb186e74c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a57754757defcddda05dd2fdeb186e74c">&#9670;&nbsp;</a></span>initWithCall()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void com.juphoon.cloud.JCPushTemplate.initWithCall </td>
          <td>(</td>
          <td class="paramtype">@PushManufacturer int&#160;</td>
          <td class="paramname"><em>pushFactory</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>selfId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>description</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>passThrough</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>huaweiNotifyJson</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>生成通话推送参数</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pushFactory</td><td>推送厂商 </td></tr>
    <tr><td class="paramname">selfId</td><td>自身唯一标识符 </td></tr>
    <tr><td class="paramname">description</td><td>描述信息 </td></tr>
    <tr><td class="paramname">passThrough</td><td>"1"表示透传消息，"0"表示非透传消息 </td></tr>
    <tr><td class="paramname">huaweiNotifyJson</td><td>当 passThrough 为 "0" 时，填华为的通知栏模版 json, 参看华为官方文档 ${Text} 消息内容 ${Sender} 发送者 { "hps": { "msg": 传这段******* { "type": 3, "body": { "content": "${Caller}", "title": "来电" }, "action": { "type": 1, "param": { "intent": "intent://com.juphoon.cloud.sample/MainActivity#Intent;scheme=customscheme;launchFlags=0x14000000;B.isFromPush=true;S.ContactNumber=${Caller};end" } } }, 传这段******* "ext": { "biTag": "Trump" } } } </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ac439a3ad1106ea4e17540609461535eb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac439a3ad1106ea4e17540609461535eb">&#9670;&nbsp;</a></span>initWithText()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void com.juphoon.cloud.JCPushTemplate.initWithText </td>
          <td>(</td>
          <td class="paramtype">@PushManufacturer int&#160;</td>
          <td class="paramname"><em>pushFactory</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>selfId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>description</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>passThrough</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>huaweiNotifyJson</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>生成消息类推送参数</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pushFactory</td><td>推送厂商 </td></tr>
    <tr><td class="paramname">selfId</td><td>自身唯一标识符 </td></tr>
    <tr><td class="paramname">type</td><td>消息类型 </td></tr>
    <tr><td class="paramname">description</td><td>提示内容，针对文本消息如果要提示发送内容，则填 null，类似文件消息则要填相应的信息，例如 "发送了一段语音" </td></tr>
    <tr><td class="paramname">passThrough</td><td>"1"表示透传消息，"0"表示非透传消息 ${Text} 消息内容 ${Sender} 发送者 { "hps": { "msg": 传这段******* { "type": 3, "body": { "content": "${Text}", "title": "收到一条短消息" }, "action": { "type": 1, "param": { "intent": "intent://com.cmi.jegotrip/message_detail#Intent;scheme=customscheme;launchFlags=0x14000000;B.isFromPush=true;S.content=${Text};S.ContactNumber=${Sender};end" } } }, 传这段******* "ext": { "biTag": "Trump" } } } </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="af3889147f307b5065c67a5e41a7e215c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af3889147f307b5065c67a5e41a7e215c">&#9670;&nbsp;</a></span>getData()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">String com.juphoon.cloud.JCPushTemplate.getData </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>返回推送参数</p>
<dl class="section return"><dt>Returns</dt><dd>推送参数 </dd></dl>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a9a7cac280e92a23672dbcef3e5b03d65"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9a7cac280e92a23672dbcef3e5b03d65">&#9670;&nbsp;</a></span>XIAOMI</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">final int com.juphoon.cloud.JCPushTemplate.XIAOMI = 0</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>小米推送 </p>

</div>
</div>
<a id="a8641da1c5058e925c89001fca7ad168e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8641da1c5058e925c89001fca7ad168e">&#9670;&nbsp;</a></span>HUAWEI</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">final int com.juphoon.cloud.JCPushTemplate.HUAWEI = 1</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>华为推送 </p>

</div>
</div>
<a id="a73bad171784091fc8c0862bc5e2cb536"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a73bad171784091fc8c0862bc5e2cb536">&#9670;&nbsp;</a></span>GCM</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">final int com.juphoon.cloud.JCPushTemplate.GCM = 2</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>GCM推送 </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>cloud/src/main/common/com/juphoon/cloud/JCPushTemplate.java</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
